"""
settings.py

Configuration for Flask app

Important: Place your keys in the secret_keys.py module, 
           which should be kept out of version control.

"""

import os

from secret_keys import CSRF_SECRET_KEY, SESSION_KEY
from secret_keys import PAYSON_AGENT_ID, PAYSON_AGENT_KEY
from secret_keys import RECAPTCHA_PRIVATE_KEY


DEBUG_MODE = False

# Auto-set debug mode based on App Engine dev environ
if 'SERVER_SOFTWARE' in os.environ and os.environ['SERVER_SOFTWARE'].startswith('Dev'):
    DEBUG_MODE = True
    PAYSON_API_ENDPOINT = 'https://test-api.payson.se'
    PAYSON_AGENT_ID = '1'
    PAYSON_AGENT_KEY = 'fddb19ac-7470-42b6-a91d-072cb1495f0a'
    PAYSON_WWW_PAY_FORWARD_URL = 'https://test-www.payson.se/paysecure/?token=%s'
else:
    PAYSON_API_ENDPOINT = 'https://api.payson.se'
    PAYSON_WWW_PAY_FORWARD_URL = 'https://www.payson.se/paysecure/?token=%s'

DEBUG = DEBUG_MODE
TESTING = DEBUG_MODE

# Set secret keys for CSRF protection
SECRET_KEY = CSRF_SECRET_KEY
CSRF_SESSION_KEY = SESSION_KEY

CSRF_ENABLED = True

RECAPTCHA_PUBLIC_KEY = '6LeB_tQSAAAAAGisRaSUN-xAUUusPtd8s7ubz8Y_'
RECAPTCHA_OPTIONS = {'theme': 'white'}
RECAPTCHA_USE_SSL = True

